package com.example.leo.mycharmingstudent.project.util;

import android.content.Context;
import android.graphics.Point;
import android.view.WindowManager;

/**
 * Created by Leo on 2020/9/30.
 */

public class WindowUtil {

    private static WindowManager getWindowManager(Context context) {
        return (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
    }

    /**
     * 获取屏幕宽高
     * point.x 宽
     * point.y 高
     * @param context
     * @return
     */
    public static Point getWindowPoint(Context context) {
        WindowManager windowManager = getWindowManager(context);
        Point point = new Point();
        windowManager.getDefaultDisplay().getSize(point);
        return point;
    }

}
